POST
/
toptimize
/
v1
/
rank
curl --request POST \
  --url https://api.topsort.com/toptimize/v1/rank \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "ranking": [
    {
      "type": "listings",
      "slots": 3,
      "pageSize": 3,
      "category": {
        "ids": [
          "sneakers",
          "shoes"
        ]
      },
      "products": {
        "ids": [
          "p_PJbnN",
          "p_ojng4"
        ]
      }
    }
  ]
}'
{
  "results": [
    {
      "products": [
        {
          "rank": 1,
          "type": "organic",
          "id": "p_Mfk11",
          "resolvedItemId": "WyJiX01mazExIiwiMTJhNTU4MjgtOGVhZC00Mjk5LTMyNjYtY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0=="
        },
        {
          "rank": 2,
          "type": "sponsored",
          "id": "p_Mfk15",
          "resolvedItemId": "WyJiX01mazE1IiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0="
        },
        {
          "rank": 3,
          "type": "organic",
          "id": "p_PJbnN",
          "resolvedItemId": "WyJlX1BKYm5OIiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0="
        }
      ],
      "error": false
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

The context information to get the ranking, to rank organic and sponsored products.

The body is of type object.

Response

201
application/json

The ranking results. The list of winners will contain at most slots entries per auction. It may contain fewer or no entries at all if there aren't enough products to fill the slots.

The response is of type object.